#ifndef __LINKTREE_H_
#define __LINKTREE_H_
#define ElementType char*
struct TreeNode
{
    ElementType data;
    struct TreeNode *parent;
    struct TreeNode *firstChild;
    struct TreeNode *nextSbiling;
};

typedef struct TreeNode TNode;
TNode *CreateTreeNode(ElementType element);
void ConnectBranch(TNode *parent,TNode *child);
void DisconnectBranch(TNode *parent,TNode *child);
void FreeNode(TNode *node);
int GetTreeHeight(TNode *node);
int GetChildCount(TNode *node);
TNode *FindNode(TNode *node,ElementType data,int(*p)(ElementType,ElementType));
TNode *CopyTree(TNode *node);



struct LinkTree
{
    struct TreeNode *root;
};

typedef struct LinkTree LTree;
int InitTree(LTree *tree);
void Travel(LTree *tree);
void FreeTree(LTree *tree);


#endif